-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix #14334: Support more msbuild conditional constructs #8039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a8ea143 to
dade829
Compare
|
Thanks for your contribution. Please avoid adding test-only code in the production code. See e04019c for an approach. If you inherit from |
| tokenlist.createAst(); | ||
| for (const Token *tok = tokenlist.front(); tok; tok = tok->next()) { | ||
| if (tok->str() == "(" && tok->astOperand1() && tok->astOperand2()) { | ||
| // TODO: this is wrong - it is Contains() not Equals() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have filed a ticket for this since fixing it is a behavior change. Are you able to do that or should I file one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you do that? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do later. I want to have a reproducer first.
Currently |
Sorry that I missed that.
Let's get the CI to pass first and the other stuff addressed and then I will have another look. It won't be merged before we made the 2.19 release anyways. |
a327364 to
e674fb6
Compare
0818e64 to
f0810d5
Compare
lib/importproject.cpp
Outdated
| if (startsHere(i, "$(Configuration.")) | ||
| { | ||
| initialized = true; | ||
| if (startsHere(i, "Contains(")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to have spaces.. Contains ( ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never have seen this, but it seems to be possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would assume that these expressions can be handwritten? So some spaces should be expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already have added support here
c1c4c5e to
35be150
Compare
bf81c63 to
f9f9c64
Compare
|
The selfcheck failure seems like an cppcheck error: without I get |
|
|
I only rebased with main |
danmar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you tokenize as before? That would get rid of a lot of the string handling. And it is more flexible it will allow spaces between tokens. As far as I see your code requires for instance that there is no spaces in $(Configuration) .
| throw std::runtime_error("Expecting a start of a string!"); | ||
| } | ||
| auto start = ++i; | ||
| while (i < expr.length() && expr[i] != '\'') ++i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| while (i < expr.length() && expr[i] != '\'') ++i; | |
| i = expr.find('\'', i); |
| } | ||
| auto start = ++i; | ||
| while (i < expr.length() && expr[i] != '\'') ++i; | ||
| std::string string = expr.substr(start, i - start); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that the string can be created below after checking if i is valid.
Because I only know that it didn't worked. Does the tokenizer know how to tokenize in strings? Feel free do create a PR at my feature branch :) |



No description provided.